﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dragon.Library.Framework.Dao
{
    public partial class BaseDao<T, TKeyT>
    {
        public IList ExecProcedure(string procedureName, Dictionary<string, object> parameter)
        {
            var query = Session.GetNamedQuery(procedureName);
            if (parameter == null || parameter.Count <= 0)
                return query.List();
            foreach (var o in parameter)
            {
                query.SetParameter(o.Key, o.Value);
            }
            return query.List();
        }
    }
}
